#
# Configures IIS Logging for ISEG
# Last Updated By: Nate Bruneau (nathbr) | 8/6/2009
#

Write-Host -ForegroundColor Yellow "IIS: Configuring IIS Logging for $env:computername."

& "$env:windir\system32\inetsrv\appcmd" set config -section:system.applicationHost/log /centralLogFileMode:"CentralW3C" /commit:apphost
& "$env:windir\system32\inetsrv\appcmd"  set config -section:system.applicationHost/log /centralW3CLogFile.directory:"E:\W3SVC\LogFiles" /commit:apphost
& "$env:windir\system32\inetsrv\appcmd"  set config -section:system.applicationHost/log /centralW3CLogFile.localTimeRollover:"true" /commit:apphost
& "$env:windir\system32\inetsrv\appcmd"  set config -section:system.applicationHost/log /centralW3CLogFile.logExtFileFlags:"Date, Time, ClientIP, UserName, SiteName, ComputerName, ServerIP, Method, UriStem, UriQuery, HttpStatus, Win32Status, BytesSent, BytesRecv, TimeTaken, ServerPort, UserAgent, Cookie, Referer, ProtocolVersion, Host, HttpSubStatus" /commit:apphost

Write-Host -ForegroundColor Yellow "IIS: Configuring IIS Logging for $env:computername. COMPLETED"